package com.guoheng.safe.sys.controller;

import com.guoheng.safe.common.base.Result;
import com.guoheng.safe.sys.dto.basicinfo.PromiseDataAddDTO;
import com.guoheng.safe.sys.dto.basicinfo.PromiseDatePageDTO;
import com.guoheng.safe.sys.service.PromiseDataService;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 类功能描述:　BasicController
 *
 * @author Eternal
 * @date 2019-56-15 14:56
 */
@RestController
@Validated
@Api(value = "承诺信息")
public class PromiseDataController {

    @Resource
    PromiseDataService promiseDataService;

    @PostMapping(value = "basic/promise/add")
    public Result addPromiseData(@RequestBody @Valid PromiseDataAddDTO promiseDataAddDTO){
        return promiseDataService.addPromiseData(promiseDataAddDTO);
    }

    @PostMapping(value = "basic/promise/page")
    public Result getPromiseData(@RequestBody @Valid PromiseDatePageDTO pageDTO){
        return promiseDataService.getPromiseDataPage(pageDTO);
    }

}
